import { getColumnsData } from "../common";

const buySchemeListTable = [
  {
    title: "五谷丰登", // 标题
    buy_num: 5, // 购买数量
    discounts_ratio: "0.000", // 优惠比例
    sort: 0,
    status: 1 // 状态 0:下架 1:上架
  }
];

const headerList = [
  {
    width: "100px",
    label: "编号",
    prop: "id",
    sortable: true
  },
  {
    width: "380px",
    label: "标题",
    prop: "title"
  },
  {
    width: "auto",
    label: "购买数量",
    prop: "buy_num"
  },
  {
    width: "auto",
    label: "优惠比例",
    prop: "discounts_ratio"
  },
  {
    width: "auto",
    label: "排序",
    prop: "sort"
  },
  {
    label: "状态",
    prop: "status",
    showValue: [
      {
        class: "",
        key: "status",
        cellType: "switch",
        tableType: "buySchemeList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  },
  {
    label: "操作",
    width: "120px",
    hideCheck: true,
    fixed: "right",
    showValue: [
      {
        class: "",
        key: "编辑",
        cellType: "button",
        type: "primary", // 按钮类型
        buttonType: "edit",
        tableType: "buySchemeList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  }
];

const buySchemeListColumns = [];

getColumnsData("buySchemeList", buySchemeListColumns, headerList, res => {
  console.log("buySchemeList", res);
});
export { buySchemeListTable, buySchemeListColumns };
